<%@ page import="gdepot.Cart" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'cart.label', default: 'Cart')}" />
		<title><g:message code="default.edit.label" args="[entityName]" /></title>
	</head>
	<body>
	<div class="row">
		<div class="container">
			<ol class="breadcrumb">
				<li><g:link controller="user" action="index">购物车</g:link></li>
				<li>编辑购物车信息</li>
			</ol>
		</div>
	</div>

	<g:if test="${flash.message}">
		<div class="row">
			<div class="container">
				<div class="alert alert-danger" role="alert">${flash.message}</div>
			</div>
		</div>
	</g:if>
	<g:hasErrors bean="${cartInstance}">
		<div class="row">
			<div class="container">
				<div class="alert alert-danger" role="alert">
					<ul class="errors" role="alert">
						<g:eachError bean="${cartInstance}" var="error">
							<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
						</g:eachError>
					</ul>
				</div>
			</div>
		</div>
	</g:hasErrors>

	<div class="row">
		<div class="container col-md-6 col-md-offset-3">
			<div class="panel panel-primary">
				<div class="panel-heading">更新购物车信息</div>
				<div class="panel-body">
					<g:form url="[resource:cartInstance, action:'update']" method="PUT" class="form-horizontal" >
						<g:hiddenField name="version" value="${cartInstance?.version}" />
						<fieldset class="form">
							<g:render template="form"/>
						</fieldset>
						<fieldset class="buttons">
							<g:actionSubmit class="btn btn-success btn-block" action="update" value="保存" />
						</fieldset>
					</g:form>
				</div>
			</div>
		</div>
	</div>

	</body>
</html>
